package com.yun.baymax.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.yun.baymax.R;
import com.yun.baymax.adapter.ChangeThemeAdapter;
import com.yun.baymax.bean.adapter.ColorEntry;

import java.util.ArrayList;
import java.util.List;

public class ChangeThemeAct extends BaseActivity {

    private RecyclerView mRecyclerView;
    private List<ColorEntry> datas;

    @Override
    protected int setLayoutResourceId() {
        return R.layout.activity_change_theme;
    }

    @Override
    protected void initVariables() {
        datas = new ArrayList<>();
        datas.add(new ColorEntry(getString(R.string.theme_blue), R.color.colorPrimary, R.drawable.shape_circle_blue));
        datas.add(new ColorEntry(getString(R.string.theme_pink), R.color.colorPrimary4, R.drawable.shape_circle_pink));
        datas.add(new ColorEntry(getString(R.string.theme_red), R.color.colorPrimary2, R.drawable.shape_circle_red));
        datas.add(new ColorEntry(getString(R.string.theme_purple), R.color.colorPrimary6, R.drawable.shape_circle_purple));
        datas.add(new ColorEntry(getString(R.string.theme_yellow), R.color.colorPrimary5, R.drawable.shape_circle_yellow));
        datas.add(new ColorEntry(getString(R.string.theme_green_light), R.color.colorPrimary3, R.drawable.shape_circle_greenl));
        datas.add(new ColorEntry(getString(R.string.theme_green_dark), R.color.colorPrimary7, R.drawable.shape_circle_greend));
    }

    @Override
    protected void initViews(Bundle savedInstanceState) {
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        toolbar.setTitle("更换主题");
        toolbar.setNavigationIcon(R.drawable.ic_arrow_back);
        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
        LinearLayoutManager gridManager = new LinearLayoutManager(mContext);
        mRecyclerView.setLayoutManager(gridManager);
        ChangeThemeAdapter adapter = new ChangeThemeAdapter(mContext, datas);
        mRecyclerView.setAdapter(adapter);
    }

    @Override
    protected void loadData() {

    }

}
